package com.ch.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ch.model.entity.Doctor;
import com.ch.service.DoctorService;
import com.ch.mapper.DoctorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【doctor】的数据库操作Service实现
* @createDate 2024-06-14 09:43:05
*/
@Service
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor>
    implements DoctorService{
	@Autowired
	private DoctorMapper doctorMapper;

	@Override
	public IPage<Doctor> selectDoctorPage(Page<Doctor> page, String doctorName) {
		return doctorMapper.selectDoctorPage(page, doctorName);
	}

	@Override
	public List<Doctor> getDoctor(int typeId, int depId, String date) {
		return doctorMapper.getDoctor(typeId,depId,date);
	}

	@Override
	public boolean addDoctor(Doctor doctor) {
		return doctorMapper.insert(doctor)>0;
	}

	@Override
	public boolean updateDoctor(Doctor doctor) throws Exception {
		return doctorMapper.updateDoctor(doctor);
	}
}




